package gr.handmademarket.bl.operations;

import gr.handmademarket.hibernate.HibernateUtil;
import gr.handmademarket.po.implementations.Seller;

import org.hibernate.Session;

/**
 * operation that updates a seller.
 */
public class UpdateProfileOperation {

	/**
	 * the seller.
	 */
	private Seller seller;
	
	/**
	 * Creates a new RegisterSellerOperation object. 
	 *
	 */
	public UpdateProfileOperation() {
		// empty
	}
	
	/**
	 * execution method.
	 */
	@SuppressWarnings("nls")
	public void execute(){
		Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        seller = (Seller) session.merge(seller);
        session.getTransaction().commit();
	}

	/**
	 * @return seller.
	 */
	public Seller getSeller() {
		return seller;
	}

	/**
	 * @param seller
	 */
	public void setSeller(Seller seller) {
		this.seller = seller;
	}
	
}
